﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using LogTableAdapters;


/// <summary>
/// Summary description for Log_Error
/// </summary>
/// 

[System.ComponentModel.DataObject]
public class Log_ErrorBLL
{
    private Log_ErrorTableAdapter _logErrorAdapter = null;

    protected Log_ErrorTableAdapter LogErrorAdapter
    {
        get
        {
            if (_logErrorAdapter == null)
                _logErrorAdapter = new Log_ErrorTableAdapter();

            return _logErrorAdapter;
        }
    }

    [System.ComponentModel.DataObjectMethodAttribute
        (System.ComponentModel.DataObjectMethodType.Select, true)]
    public Log.Log_ErrorDataTable GetLog_Errors()
    {
        return LogErrorAdapter.GetLog_Errors();
    }

    [System.ComponentModel.DataObjectMethodAttribute
        (System.ComponentModel.DataObjectMethodType.Select, false)]
    public Log.Log_ErrorRow GetLog_Error(int LogErrorID)
    {
        try
        {
            return LogErrorAdapter.GetLog_Error(LogErrorID)[0];
        }
        catch
        {
            return null;
        }
    }

    [System.ComponentModel.DataObjectMethodAttribute
        (System.ComponentModel.DataObjectMethodType.Select, false)]
    public Log.Log_ErrorDataTable GetLog_ErrorsByUserID(int UserID)
    {
        return LogErrorAdapter.GetLog_ErrorsByUserID(UserID);
    }

    [System.ComponentModel.DataObjectMethodAttribute
        (System.ComponentModel.DataObjectMethodType.Insert, true)]
    public void InsertLog_Error(int UserID, string ErrorType, string ErrorMessage, string OS, string WebBrowser, int Severity)
    {
        try
        {
            LogErrorAdapter.InsertLog_Error(UserID, ErrorType, ErrorMessage, OS, WebBrowser, Convert.ToByte(Severity), DateTime.Now);
        }
        catch
        {
        }
    }

    [System.ComponentModel.DataObjectMethodAttribute
        (System.ComponentModel.DataObjectMethodType.Insert, false)]
    public void InsertUserReport(int LogErrorID, string UserReport)
    {
        try
        {
            LogErrorAdapter.InsertUserReport(LogErrorID, UserReport);
        }
        catch
        {
        }
    }
}
